import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/stockIn',
    name: 'stockIn',
    meta,
    redirect: { name: 'stockIn' },
    component: layoutHeaderAside,
    children: (pre => [
        {
            path: 'purchaseStockInList',
            name: `${pre}purchaseStockInList`,
            component: _import('stockIn/purchaseStockInList'),
            meta: {
                ...meta,
                title: '采购入库列表'
            }
        },
        {
            path: 'purchaseStockInDetail',
            name: `${pre}purchaseStockInDetail`,
            component: _import('stockIn/purchaseStockInDetail'),
            meta: {
                ...meta,
                title: '采购入库详情'
            }
        },
        {
            path: 'purchaseStockInAdd',
            name: `${pre}purchaseStockInAdd`,
            component: _import('stockIn/purchaseStockInAdd'),
            meta: {
                ...meta,
                title: '新建采购入库'
            }
        },
        {
            path: 'purchaseStockInUpdate',
            name: `${pre}purchaseStockInUpdate`,
            component: _import('stockIn/purchaseStockInUpdate'),
            meta: {
                ...meta,
                title: '编辑采购入库'
            }
        },
        {
            path: 'purchaseStockInDetailList',
            name: `${pre}purchaseStockInDetailList`,
            component: _import('stockIn/purchaseStockInDetailList'),
            meta: {
                ...meta,
                title: '采购入库明细'
            }
        },
        {
            path: 'otherStockInList',
            name: `${pre}otherStockInList`,
            component: _import('stockIn/otherStockInList'),
            meta: {
                ...meta,
                title: '其他入库列表'
            }
        }

    ])('stockIn-')
}
